package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.Category;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CategoryMapper {

    // 新增分类
    @AutoFill(OperationType.INSERT)
    void insert(Category category);
    //分页查询
    List<Category> selectByNameAndType(String name, Integer type);

    //更新分类数据
    @AutoFill(OperationType.UPDATE)
    void update(Category category);

    //删除分类
    @Delete("delete from category where id = #{id}")
    void deleteById(Long id);
}
